package leetcode.code2095;

import leetcode.IDebug;
import leetcode.helper.tree.ListNode;

//执行用时：3 ms, 在所有 Java 提交中击败了100.00%的用户
//
//内存消耗：61.9 MB, 在所有 Java 提交中击败了95.71%的用户
//
//通过测试用例：70 / 70
public class Solution implements IDebug {

	public ListNode deleteMiddle(ListNode head) {
		if (head.next == null) {
			return null;
		}
		ListNode l = new ListNode(), r = new ListNode();
		l.next = head;
		r.next = head;
		while (r.next != null && r.next.next != null) {
			l = l.next;
			r = r.next.next;
		}
		l.next = l.next.next;
		return head;
	}

	@Override
	public void debug1() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug2() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug3() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
